package com.example.ecity.sharedpreferences;

import android.content.Context;
import android.content.SharedPreferences;

public class MySharedPreferences {
	private SharedPreferences sp;  
    private SharedPreferences.Editor editor;
	
	public MySharedPreferences(Context context,String file){
		sp = context.getSharedPreferences(file, context.MODE_PRIVATE);  
        editor = sp.edit();  
	}
	
	public void setRange(int range){
		editor.putInt("range", range);
		editor.commit();
	}
	
	public int getRange(){
		return sp.getInt("range", 0);
	}
	
	public void setPoiType(String type){
		editor.putString("poiType", type);
		editor.commit();
	}
	
	public String getPoiType(){
		return sp.getString("poiType", "");
	}
	
	public void setButtonSrc(int src){
		editor.putInt("ImageButtonSrc",src);
		editor.commit();
	}
	
	public int getButtonSrc(){
		return sp.getInt("ImageButtonSrc", 0);
	}
	
	public void setModel(int model){
		editor.putInt("model", model);
		editor.commit();
	}
	
	public int getModel(){
		return sp.getInt("model",0);
	}
}
